# -*- encoding: utf-8 -*-
'''
@File    :   1.py
@Time    :   2022/11/29 16:11:11
@Author  :   Cms 
@Version :   1.0
@Contact :   2267000140@qq.com
@WebSite    :   www.baidu.com
'''

# here put the import lib
import time
import functools
# 1  编写一个装饰器，能计算其他函数的运行时间；

# def outer(func):
#     def inner():
#         start_time = time.time()
#         func()
#         end_time = time.time()
#         print("函数运行的时间为：",end_time-start_time)
#     return inner

def outer(func):
    @functools.wraps(func)
    def inner():
        start_time = time.time()
        func()
        end_time = time.time()
        print("函数运行的时间为：",end_time-start_time)
    return inner

@outer
def myfunc():
    print("这是我的函数！")


myfunc()

print(myfunc.__name__)